!{include file='common/iheader.htm'}
<div id="i_nav">
	<h3 class="page_title">文章分类管理</h3>
	<a class="button" href="/manager.php?app=article">文章管理</a>
	<a class="button" href="/manager.php?app=article_cate&act=edit">添加分类</a>
</div>
<ul class="list_view">
!{foreach from=$cates item=cate}
	<li>
		<strong>!{$cate.name}</strong>
		<div class="opt_div">
			<a href="/index.php?app=article&act=list&id=!{$cate._id}">预览分类</a>
			<a href="javascript:void(0)" onclick="del('!{$cate._id}')">删除</a>
			<a href="/manager.php?app=article_cate&act=edit&id=!{$cate._id}">修改</a>
			<a href="/manager.php?app=article_cate&act=edit&parent=!{$cate._id}">添加子分类</a>
			<a href="/manager.php?app=article&act=edit&parent=!{$cate._id}">添加文章</a>
			<a href="/manager.php?app=article&act=index&parent=!{$cate._id}">查看文章</a>
			<a href="/manager.php?app=article&act=order&id=!{$cate._id}">文章排序</a>
		</div>
	</li>
!{/foreach}
</ul>
<script type="text/javascript">
	function del(id){
		if(confirm('删除本纪录将不可恢复，是否继续？')){
			var url = "/manager.php?app=article_cate&act=del&id=" + id;
			$.get(url, function(data){
				var json = eval('(' + data + ')');
				if(json.result){
					alert(json.info);
					//刷新
					window.location.href = '/manager.php?app=article_cate';
				}else{
					alert(json.info);
				}
			});
		}
	}
</script>
!{include file='common/ifooter.htm'}